#!/bin/sh

cd ./src
# commonlib 
sudo g++ -c ./ConsoleLogListener.cpp -o ../obj/ConsoleLogListener.o
sudo g++ -c ./DateTime.cpp -o ../obj/DateTime.o
sudo g++ -c ./Log.cpp -o ../obj/Log.o
sudo g++ -c ./LogListener.cpp -o ../obj/LogListener.o
sudo g++ -c ./Process.cpp -o ../obj/Process.o `pkg-config --cflags --libs glib-2.0`
sudo g++ -c ./TextWriterLogListener.cpp -o ../obj/TextWriterLogListener.o
sudo g++ -c ./SystemInfo.cpp -o ../obj/SystemInfo.o
sudo g++ -c ./OSoperation.cpp -o ../obj/OSoperation.o
sudo g++ -c ./Serviceoperation.cpp -o ../obj/Serviceoperation.o
sudo g++ -c ./MemoryRelease.cpp -o ../obj/MemoryRelease.o
sudo g++ -c ./DiskRelease.cpp -o ../obj/DiskRelease.o


# gsoap
sudo g++ -c ./dom.cpp -o ../obj/dom.o
sudo g++ -c ./stdsoap2.cpp -o ../obj/stdsoap2.o

# host
sudo g++ -c ./soapHostSoap12Service.cpp -o ../obj/soapHostSoap12Service.o
sudo g++ -c ./soapC.cpp -o ../obj/soapC.o
sudo g++ -c ./soapHostSoap12Service.code.cpp -o ../obj/soapHostSoap12Service.code.o
sudo g++ -c ./soapHostSoap12ServiceImpl.cpp -o ../obj/soapHostSoap12ServiceImpl.o

# nagent
sudo g++ -c ./main.cpp -o ../obj/main.o

# build
cd ../obj
sudo g++ ConsoleLogListener.o DateTime.o Log.o LogListener.o Process.o Serviceoperation.o OSoperation.o MemoryRelease.o DiskRelease.o SystemInfo.o TextWriterLogListener.o dom.o stdsoap2.o soapHostSoap12Service.o soapC.o main.o soapHostSoap12Service.code.o soapHostSoap12ServiceImpl.o -o ../netcare-agent `pkg-config --cflags --libs glib-2.0`



